<template>
  <div class="mask-wrapper" v-if="isshow">
    <div class="mask-close_icon" @click="close">x</div>
    <div class="mask-content">
      <slot></slot>
    </div>
  </div>
</template>
<script>
  export default{
    props: {
      isshow: {
        type: Boolean,
        default: true
      }
    },
    methods: {
      'close': function () {
        this.$emit('closeMask');
      }
    }
  };
</script>
<style scoped>
  .mask-wrapper{
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(191,185,185,0.5);
  }
  .mask-wrapper>.mask-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
  }
  .mask-wrapper>.mask-close_icon{
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    text-align: center;
    line-height: 20px;
    background-color: lightgray;
    color: white;
    cursor: pointer;
  }
  .mask-wrapper>.mask-close_icon:hover{
    background-color: gray;
  }
</style>
